package view.create
{
	import model.SaveTapeModel;
	
	import subumbo.leg.view.ViewComponentMediator;
	
	import view.create.signal.SaveTapeSignal;
	
	public class CreateMediator extends ViewComponentMediator
	{
		[Inject] public var view:Create;
		[Inject] public var save:SaveTapeSignal;
		[Inject] public var _model:SaveTapeModel;
		
		public override function onRegister():void {
			_view = view;
			view.save.addOnce(saveTape);
			super.onRegister();
		}
		
		private function saveTape(files:Array, name:String):void {
			_model.files = files;
			_model.name = name;
			save.dispatch();
		}
	}
}